home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol C-14 / Vol C-14.iso / games / peanut.swf / scripts / frame_40 / DoAction.as
Text File  |  2012-04-23  |  1KB  |  57 lines

  1. rate = int(score / "50");
  2. if(defmove1 == "0" and def1down == "0" and random("60" - rate) == "0")
  3. {
  4.    defmove1 = "1";
  5.    tellTarget("/defender1")
  6.    {
  7.       if(eval("../:def1X") < "160")
  8.       {
  9.          gotoAndStop("right");
  10.          play();
  11.       }
  12.       else if("430" < eval("../:def1X"))
  13.       {
  14.          gotoAndStop("left");
  15.          play();
  16.       }
  17.       else if(random("2") == "0")
  18.       {
  19.          gotoAndStop("right");
  20.          play();
  21.       }
  22.       else
  23.       {
  24.          gotoAndStop("left");
  25.          play();
  26.       }
  27.    }
  28. }
  29. if(defmove2 == "0" and def2down == "0" and random("60" - rate) == "0")
  30. {
  31.    defmove2 = "1";
  32.    tellTarget("/defender2")
  33.    {
  34.       if(eval("../:def2X") < "160")
  35.       {
  36.          gotoAndStop("right");
  37.          play();
  38.       }
  39.       else if("430" < eval("../:def2X"))
  40.       {
  41.          gotoAndStop("left");
  42.          play();
  43.       }
  44.       else if(random("2") == "0")
  45.       {
  46.          gotoAndStop("right");
  47.          play();
  48.       }
  49.       else
  50.       {
  51.          gotoAndStop("left");
  52.          play();
  53.       }
  54.    }
  55. }
  56. prevFrame();
  57.